<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>首页</title>
    <script src="js/mui.min.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <style type="text/css">
    	#welcome {
    		height: 100vh;
    		width: 100vw;
    	}
    	#welcome img{
    		height: 100vh;
    		width: 100vw;
    	}
    	#welbtn {
    		height: ;
    		width:20vw;
    		position: absolute;
    		bottom: 12.5%;
    		left: 38%;
    		z-index: 2;
    	}
    </style>
</head>
<body>
	<!--welcome欢迎界面-->
	<div class="mui-slider" id="welcome">
		<div class="mui-slider-group">
			<div class="mui-slider-item">
				<a href="#"><img src="./images/welcome/cbd.jpg"/></a>
			</div>
			<div class="mui-slider-item">
				<a href="#"><img src="images/welcome/muwu.jpg"/></a>
			</div>
			<div class="mui-slider-item">
				<a href="#"><img src="images/welcome/shuijiao.jpg"/></a>
			</div>
			<div class="mui-slider-item">
				<button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" id="welbtn">立即体验</button>
				<a href="#"><img src="images/welcome/yuantiao.jpg"/></a>
			</div>
		</div>
		<div class="mui-slider-indicator">
			<div class="mui-indicator mui-active"></div>
			<div class="mui-indicator"></div>
			<div class="mui-indicator"></div>
			<div class="mui-indicator"></div>
		</div>
		
	</div>
	<script type="text/javascript">
		mui.init({
			//开启按键监听
			keyEventBind:{
				backbutton:false,
				menubutton:false
			},
			//关闭右滑关闭功能
			swipeback:true,
			//预加载主页面及其子页面
			preloadPages:[
				{
					url:'main.html',
					id:"main",
					styles:{
						top:'0px',
						bottom:'0px'
					},
				}
			]
		});
		//预加载主页页面
		/*var main = mui.preload({
			url: 'main.html',
			id: 'main',
			styles : {
				top: '0px',
				bottom : '0px'
			}
		});*/
		mui.plusReady(function(){
			plus.screen.lockOrientation('portrait-primary');
			/*
			 * 检测是否预加载成功
			 * setTimeout(function(){
				var array = plus.webview.all();
				if(array){
					for(var i = 0,len = array.length;i<len;i++){
						console.log(array[i].getURL());
					}
				}
			},10000)*/
		});
		//欢迎页图片循环
		var gallery = mui('.mui-slider');
		gallery.slider({
			interval:0
		});
		
		//欢迎页单击打开主页事件
		document.getElementById('welbtn').addEventListener('tap',function(){
			plus.nativeUI.showWaiting('加载中...');
			plus.webview.create('main.html','main',{top:'0px',bottom:'0px'});
		},false);
	</script>
</body>
</html>